﻿namespace IPMS.BLL
{
    using IPMS.DAL;
    using System;
    using System.Data;
    using System.Data.SqlClient;

    public class HeadingSets
    {
        private string _HeadingSetName;

        public int GetHeadingSetInfo(string headingSet)
        {
            SqlCommand sqlCmd = new SqlCommand();
            DataAccessLayer DAL = new DataAccessLayer();
            DAL.AddParamToSQLCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, null);
            DAL.AddParamToSQLCmd(sqlCmd, "@HeadingSet", SqlDbType.NVarChar, 30, ParameterDirection.Input, headingSet);
            DAL.AddParamToSQLCmd(sqlCmd, "@HeadingSetName", SqlDbType.NVarChar, 30, ParameterDirection.Output, null);
            DAL.SetCommandType(sqlCmd, CommandType.StoredProcedure, "RetrieveHeadingSetSp");
            DAL.ExecuteScalarCmd(sqlCmd);
            int resultValue = (int) sqlCmd.Parameters["@ReturnValue"].Value;
            this._HeadingSetName = (string) sqlCmd.Parameters["@HeadingSetName"].Value;
            return resultValue;
        }

        public string HeadingSetName
        {
            get
            {
                return this._HeadingSetName;
            }
        }
    }
}

